<?php
class Adm_Action_Helper_LoadEntities extends Zend_Controller_Action_Helper_Abstract
{
	public function loadEntities()
	{
		$session = Zend_Registry::get('session');
		$controller = $this->getActionController();
		$userId  = null;
		
		if ( !isset( $session->userId ) ){
			return;
		}
		
		$user =  $this->loadAdmin( $session->userId );				
		

	}
	
	protected function loadAdmin( $userId )
	{	
		$mapper = Vs_Factory::mapper( 'User' );
		$user = $mapper->getById( $userId );
		$this->getActionController()->user = $user;
		$this->getActionController()->view->user = $user;
		return $user;
	}

}